package controleur;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JButton;
import javax.swing.JDialog;

public class ActionOkDialog extends AbstractAction{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JDialog c = null;
	public ActionOkDialog(JDialog c) {
		this.c = c;
		putValue( Action.NAME, "Ok" );
		putValue( Action.SHORT_DESCRIPTION, "Ferme les préférences");
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if(e.getSource().getClass() != JButton.class)
			return;
		c.setVisible(false);
	}
}
